package com.ljf.tijian.controller;

import com.ljf.tijian.ApiResponse;
import com.ljf.tijian.pojo.Orders;
import com.ljf.tijian.pojo.Users;
import com.ljf.tijian.service.ReportService;
import org.checkerframework.checker.units.qual.A;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class ReportController {

    @Autowired
    ReportService reportService;

    @RequestMapping("/getallreports")
    public ApiResponse getallreports(@RequestBody Users users){
        return reportService.getAllReport(Long.parseLong(users.getUserId()));
    }

    @RequestMapping("/getreportconclusion")
    public ApiResponse getreportconclusion(@RequestBody Orders orders){
        return reportService.getReportConclusion(Integer.valueOf(orders.getOrderId()));
    }

    @RequestMapping("/getreportdetail")
    public ApiResponse getreportdetail(@RequestBody Orders orders){
        return reportService.getReportDetail(Integer.valueOf(orders.getOrderId()));
    }


}
